/**
 * 
 */
package org.t2.game.server.module.difchannel;

import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.t2.game.server.foundation.starting.ApplicationSettings;
import org.t2.game.server.module.recharge.model.RechargeOrder;

import pb.t2.protobuf.player.Player.PlayerLoginRequest;

/**
 * 
 */
public abstract class DifChannelService {

	protected static Logger logger = LoggerFactory.getLogger(DifChannelService.class);
	
	@Autowired
	protected ApplicationSettings applicationSettings;
	
	private static Map<String, DifChannelService> serviceMap = new HashMap<>();
	public static DifChannelService getService(String code) {
		return serviceMap.get(code);
	}
	
	public DifChannelService() {
		serviceMap.put(this.code(), this);
	}
	
	public abstract String code();
	
	public abstract void onLogin(PlayerLoginRequest request);
	
	public abstract void onRecharge(RechargeOrder rechargeOrder);
}
